package me.zhengjie.controller;

import lombok.RequiredArgsConstructor;
import me.zhengjie.pojo.entity.PageBean;
import me.zhengjie.pojo.vo.ReturnVo;
import me.zhengjie.sqlservice.WcsLineBodyAbnormalHistoryService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class WcsLineBodyAbnormalHistoryController {
    private final WcsLineBodyAbnormalHistoryService wcsLineBodyAbnormalHistoryService;
    @GetMapping("/page")
    public ReturnVo Page(Integer page, Integer size,
                         @RequestParam(required = false)
                         String containerCode,
                         @RequestParam(required = false)
                         String abnormalInformation,
                         @RequestParam(required = false)
                         Integer palletId,
                         @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

                         @RequestParam(name = "times",required = false)List<LocalDateTime> times)
    {
        PageBean page1 = wcsLineBodyAbnormalHistoryService.Page(page, size, containerCode, abnormalInformation, palletId, times);
        return ReturnVo.OK(page1);
    }

}
